]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowPreview: Handle case where window already is part of layout
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 24 Oct 2020 18:51:56 +0000 (20:51 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 26 Oct 2020 03:40:19 +0000 (03:40 +0000)
We sometimes add dialogs multiple times to the WindowPreview, for
example for modal dialogs we receive both the "window-added" and the
"window-entered-monitor" signal, which means we call
WindowPreview.addDialog() twice.

We handle that fine already in the WindowPreviewLayout and return NULL
in case the window already was added, so simply handle that NULL return
value and bail out of WindowPreview.addDialog() in this case.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1482

js/ui/windowPreview.js

index 5630ba5e31c238dc0a4154dcc58c103f27e57bd7..d379703dd8e536f02bfac289f65d2f86800d5e45 100644 (file)
@@ -500,6 +500,8 @@ var WindowPreview = GObject.registerClass({
 
     _addWindow(metaWindow) {
         const clone = this._windowContainer.layout_manager.addWindow(metaWindow);
+        if (!clone)
+            return;
 
         // We expect this to be used for all interaction rather than
         // the ClutterClone; as the former is reactive and the latter